#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>

#define SHOW_DATA _IOR('S',0X01,unsigned short)
    
int main()
{
	int fd,status=0;
	unsigned short data;
	char idex,code;
	fd = open("/dev/drv_spi_m74hc595", O_RDWR);
	if(fd < 0)
	{
		printf("drv_spi_m74hc595 open err\r\n");
		exit(1);
	}
	idex=1;
	code = 6;
	data = (code<<8)|idex;
	ioctl(fd, SHOW_DATA, data);
	while(1)
	{
		
		sleep(1);
		if(status)
		{
			status=0;
		}
		else
		{
			status=1;
		}
	}
	close(fd);
}
